Skip to content

Conversation

@EconomicTouristsArmLate
Copy link

@EconomicTouristsArmLate EconomicTouristsArmLate commented Jun 17, 2024

Followup to #1063, which landed in 0.25.0:

When fetching logs of probes, this added URL query parameter allows to uniquely identify a probe log by target and module.

Previously with the ?target= selector only (added in #1063), it was impossible to select the correct probe log, when multiple modules had probed a target.

In other words - this addition is a requirement, for reliably linking to the latest log of a probe with a given module (for example from dashboards).

@EconomicTouristsArmLate EconomicTouristsArmLate force-pushed the feat-logs-add-module-filter branch 7 times, most recently from dabf913 to 4f0f1f6 Compare June 18, 2024 12:30
@EconomicTouristsArmLate EconomicTouristsArmLate force-pushed the feat-logs-add-module-filter branch from 4f0f1f6 to b9628bc Compare August 7, 2024 14:09
@EconomicTouristsArmLate
Copy link
Author

rebased onto latest master

@EconomicTouristsArmLate EconomicTouristsArmLate changed the title feat: Add optional /logs?module= filter parameter Fix retrieving probe logs by target name when probed by multiple modules Aug 7, 2024
@github-actions github-actions bot added the stale label Dec 30, 2024
noerw added 2 commits January 7, 2025 11:29
This allows to uniquely identify a probe by target and module.

Previously with the `?target=` selector only,  it was impossible to
select the correct probe log, when multiple modules had probed a target.

Signed-off-by: Norwin Roosen <[email protected]>
Signed-off-by: Norwin Roosen <[email protected]>
@EconomicTouristsArmLate
Copy link
Author

not stale, just waiting for review...
just rebased onto latest master.

Copy link
Member

@electron0zero electron0zero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few nits and a comment, rest lgtm.

can you also update the PR description as per the new PR template: https://github.com/prometheus/blackbox_exporter/blob/master/.github/PULL_REQUEST_TEMPLATE.md

if resultFalse.Target != "target-1" {
t.Errorf("Error finding the result in history by target for target: expected \"%s\" and got \"%s\"", "target-1", resultFalse.Target)
}
if resultFalse.ModuleName != "module-1" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also have "module-0", "target-1" entry, so shouldn't we check for both?


// Get returns a given result by url.
func (rh *ResultHistory) GetByTarget(target string) *Result {
// GetByTarget returns a given result by url, optionally filtered by a module name.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we should rename the method to show that module is also supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants